$(function () {
    queryAjaxSelectArticle(1);
    $('body').on('click','#btn1,#btn2',function () {
        //点击搜索查询从第一页开始查询
        queryAjaxSelectArticle(1);
    });
});

function queryAjaxSelectArticle(pageNo) {
    var params = $("#search-form").serializeJSON();
    params = JSON.stringify(params);
    var obj = {
        url: baseloaction + '/admin/op/article/ajaxSelectArticleList',//请求URL
        contextId: 'article-list-context',//响应内容页面设置内容ID
        params: params,//请求参数
        pageNo: pageNo,//页码
        pageCall: queryAjaxSelectArticle, //分页回调加载数据(点击上下页时调用,该方法也在加载页面完成时调用)
        selectAllId: '', //全选框ID
        callback: function () {//数据加载完成回调

        }
    };
    ajaxGetListData(obj);
}


/**
 * 获取选中学员
 */
function getSelectArticle() {
    var input = $('#article-list-context input.i-checks:checked');
    if (input.length == 0) {
        icModale(0, "请选择用户数据");
        return null;
    }
    var result = null;
    if (selectType == null || $.trim(selectType) == '' || typeof  selectType == 'undefined' || selectType == 'radio') {
        result = input[0];
        var _m = $(input[0]);
        result = {
            'id': _m.val(),
            'articleName':_m.attr("title")
        };
    } else {
        result = new Array();
        $.each(input, function (index, _m) {
            _m = $(_m);
            var _mould = {
                'id': _m.val(),
                'articleName':_m.attr("title")
            };
            result.push(_mould);
        });
    }
    return result;
}
